package com.cxyzy.demo

import androidx.lifecycle.MutableLiveData
import com.cxyzy.demo.base.BaseViewModel

class TaskViewModel() : BaseViewModel() {
    var todayTask: MutableLiveData<Task> = MutableLiveData()
    var futureTask: MutableLiveData<Task> = MutableLiveData()

    private val taskRepo by lazy { TaskRepo() }

    fun queryTodayTask() {
        launch(block = { todayTask.value = taskRepo.query() })
    }

    fun queryFutureTask() {
        launch(block = { futureTask.value = taskRepo.query2() })
    }
}